home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat2 / standard / sigaction.z / sigaction
Encoding:
Text File  |  2002-10-03  |  13.9 KB  |  199 lines

  1.  
  2.  
  3.  
  4. SSSSIIIIGGGGAAAACCCCTTTTIIIIOOOONNNN((((2222))))                                                      SSSSIIIIGGGGAAAACCCCTTTTIIIIOOOONNNN((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      sigaction - software signal facilities (POSIX)
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssiiiiggggnnnnaaaallll....hhhh>>>>
  13.  
  14.      _CCCC_::::
  15.        ssssttttrrrruuuucccctttt ssssiiiiggggaaaaccccttttiiiioooonnnn {{{{
  16.           iiiinnnntttt ssssaaaa____ffffllllaaaaggggssss;;;;
  17.           uuuunnnniiiioooonnnn {{{{
  18.                vvvvooooiiiidddd ((((****ssssaaaa____hhhhaaaannnnddddlllleeeerrrr))))(((())));;;;
  19.                vvvvooooiiiidddd ((((****ssssaaaa____ssssiiiiggggaaaaccccttttiiiioooonnnn))))((((iiiinnnntttt,,,, ssssiiiiggggiiiinnnnffffoooo____tttt ****,,,, vvvvooooiiiidddd ****))));;;;
  20.           }}}}
  21.           ssssiiiiggggsssseeeetttt____tttt ssssaaaa____mmmmaaaasssskkkk;;;;
  22.        }}}};;;;
  23.  
  24.      _CCCC_++++_++++_::::
  25.        ssssttttrrrruuuucccctttt ssssiiiiggggaaaaccccttttiiiioooonnnn {{{{
  26.           iiiinnnntttt ssssaaaa____ffffllllaaaaggggssss;;;;
  27.           uuuunnnniiiioooonnnn {{{{
  28.                vvvvooooiiiidddd ((((****ssssaaaa____hhhhaaaannnnddddlllleeeerrrr))))((((iiiinnnntttt))));;;;
  29.                vvvvooooiiiidddd ((((****ssssaaaa____ssssiiiiggggaaaaccccttttiiiioooonnnn))))((((iiiinnnntttt,,,, ssssiiiiggggiiiinnnnffffoooo____tttt ****,,,, vvvvooooiiiidddd ****))));;;;
  30.           }}}}
  31.           ssssiiiiggggsssseeeetttt____tttt ssssaaaa____mmmmaaaasssskkkk;;;;
  32.        }}}};;;;
  33.  
  34.      iiiinnnntttt ssssiiiiggggaaaaccccttttiiiioooonnnn((((iiiinnnntttt ssssiiiigggg,,,, ssssttttrrrruuuucccctttt ssssiiiiggggaaaaccccttttiiiioooonnnn ****aaaacccctttt,,,,
  35.                             ssssttttrrrruuuucccctttt ssssiiiiggggaaaaccccttttiiiioooonnnn ****ooooaaaacccctttt))));;;;
  36.  
  37. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  38.      _s_i_g_a_c_t_i_o_n specifies and reports on the way individual signals are to be
  39.      handled in the calling process.
  40.  
  41.      _s_i_g specifies the signal and can be assigned any of the signals specified
  42.      in ssssiiiiggggnnnnaaaallll((((5555)))).
  43.  
  44.      If _a_c_t is non-zero, it points to a structure specifying the new action to
  45.      be taken when delivering _s_i_g. If _o_a_c_t is non-zero, the previous handling
  46.      information for the signal is returned to the user.  In this way (a NULL
  47.      _a_c_t and a non-NULL _o_a_c_t) the user can enquire as to the current handling
  48.      of a signal without changing it.  If both _a_c_t and _o_a_c_t are NULL,
  49.      _s_i_g_a_c_t_i_o_n will return EEEEIIIINNNNVVVVAAAALLLL if _s_i_g is an invalid signal (else 0),
  50.      allowing an application to dynamically determine the set of signals
  51.      supported by the system.
  52.  
  53.      If the SA_SIGINFO flag is clear in ssssaaaa____ffffllllaaaaggggssss then ssssaaaa____hhhhaaaannnnddddlllleeeerrrr specifies the
  54.      disposition of the signal and may take any of the values specified in
  55.      ssssiiiiggggnnnnaaaallll((((5555)))).
  56.  
  57.      If the SA_SIGINFO flag is set in ssssaaaa____ffffllllaaaaggggssss then ssssaaaa____ssssiiiiggggaaaaccccttttiiiioooonnnn specifies the
  58.      disposition of the signal and may take a pointer to a function.
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SSSSIIIIGGGGAAAACCCCTTTTIIIIOOOONNNN((((2222))))                                                      SSSSIIIIGGGGAAAACCCCTTTTIIIIOOOONNNN((((2222))))
  71.  
  72.  
  73.  
  74.      ssssaaaa____mmmmaaaasssskkkk specifies a set of signals to be blocked while the signal handler
  75.      is active. On entry to the signal handler, that set of signals is added
  76.      to the set of signals already being blocked when the signal is delivered.
  77.      In addition, the signal that caused the handler to be executed will also
  78.      be blocked, unless the _SSSS_AAAA______NNNN_OOOO_DDDD_EEEE_FFFF_EEEE_RRRR flag has been specified.  Keep in mind
  79.      that _SSSS_AAAA______NNNN_OOOO_DDDD_EEEE_FFFF_EEEE_RRRR is superseded by ssssaaaa____mmmmaaaasssskkkk so that if _SSSS_AAAA______NNNN_OOOO_DDDD_EEEE_FFFF_EEEE_RRRR is set but
  80.      the same signal is specified in ssssaaaa____mmmmaaaasssskkkk, the signal will still be
  81.      blocked.  _SSSS_IIII_GGGG_SSSS_TTTT_OOOO_PPPP and _SSSS_IIII_GGGG_KKKK_IIII_LLLL_LLLL cannot be blocked (the system silently
  82.      enforces this restriction).  The user constructs this mask via the
  83.      routines described in _ssss_iiii_gggg_ssss_eeee_tttt_oooo_pppp_ssss(3).
  84.  
  85.      The _s_a__f_l_a_g_s field specifies a set of flags used to modify the delivery
  86.      of the signal.  It is formed by a logical OR of any of the following
  87.      values:
  88.  
  89.           _SSSS_AAAA______OOOO_NNNN_SSSS_TTTT_AAAA_CCCC_KKKK   If set and the signal is caught and an alternate signal
  90.                        stack has been declared with _ssss_iiii_gggg_aaaa_llll_tttt_ssss_tttt_aaaa_cccc_kkkk(2), the signal
  91.                        is delivered to the calling process on that stack.
  92.                        Otherwise, the signal is delivered on the same stack as
  93.                        the main program.
  94.  
  95.           _SSSS_AAAA______RRRR_EEEE_SSSS_EEEE_TTTT_HHHH_AAAA_NNNN_DDDD If set and the signal is caught, the disposition of the
  96.                        signal is reset to _SSSS_IIII_GGGG______DDDD_FFFF_LLLL (_SSSS_IIII_GGGG_IIII_LLLL_LLLL, _SSSS_IIII_GGGG_TTTT_RRRR_AAAA_PPPP, and _SSSS_IIII_GGGG_PPPP_WWWW_RRRR
  97.                        cannot be automatically reset when delivered; the
  98.                        system silently enforces this restriction).
  99.  
  100.           _SSSS_AAAA______NNNN_OOOO_DDDD_EEEE_FFFF_EEEE_RRRR   If set and the signal is caught, the signal will not be
  101.                        automatically blocked by the kernel while it is being
  102.                        caught.
  103.  
  104.           _SSSS_AAAA______RRRR_EEEE_SSSS_TTTT_AAAA_RRRR_TTTT   If set and the signal is caught, a system call that is
  105.                        interrupted by the execution of this signal's handler
  106.                        is transparently restarted by the system.  Otherwise,
  107.                        that system call returns an _EEEE_IIII_NNNN_TTTT_RRRR error.
  108.  
  109.           _SSSS_AAAA______SSSS_IIII_GGGG_IIII_NNNN_FFFF_OOOO   If set and the signal is caught, _s_i_g is passed as the
  110.                        first argument to the signal-catching function.  If the
  111.                        second argument is not equal to _NNNN_UUUU_LLLL_LLLL, it points to a
  112.                        _ssss_iiii_gggg_iiii_nnnn_ffff_oooo______tttt structure containing the reason why the
  113.                        signal was generated [see _ssss_iiii_gggg_iiii_nnnn_ffff_oooo(5)]; the third
  114.                        argument points to a _uuuu_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt______tttt structure containing
  115.                        the receiving process's context when the signal was
  116.                        delivered [see _uuuu_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt(5)].  If cleared and the signal
  117.                        is caught, the first argument is also the signal number
  118.                        but the second argument is the signal code identifying
  119.                        the cause of the signal. The third argument points to a
  120.                        _ssss_iiii_gggg_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt______tttt structure containing the receiving
  121.                        process's context when the signal was delivered. This
  122.                        is the default behavior (see _ssss_iiii_gggg_nnnn_aaaa_llll_((((_5555_)))) for more
  123.                        details).  Additionally, when _SSSS_AAAA______SSSS_IIII_GGGG_IIII_NNNN_FFFF_OOOO is set for a
  124.                        signal, multiple occurrences of that signal will be
  125.                        queued for delivery in FIFO order (see _ssss_iiii_gggg_qqqq_uuuu_eeee_uuuu_eeee(3) for
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. SSSSIIIIGGGGAAAACCCCTTTTIIIIOOOONNNN((((2222))))                                                      SSSSIIIIGGGGAAAACCCCTTTTIIIIOOOONNNN((((2222))))
  137.  
  138.  
  139.  
  140.                        a more detailed explanation of this concept), if those
  141.                        occurrences of that signal were generated using
  142.                        _ssss_iiii_gggg_qqqq_uuuu_eeee_uuuu_eeee(3).
  143.  
  144.           _SSSS_AAAA______NNNN_OOOO_CCCC_LLLL_DDDD_WWWW_AAAA_IIII_TTTT If set and _s_i_g equals _SSSS_IIII_GGGG_CCCC_HHHH_LLLL_DDDD, the system will not
  145.                        create zombie processes when children of the calling
  146.                        process exit.  If the calling process subsequently
  147.                        issues a _wwww_aaaa_iiii_tttt(2), it blocks until all of the calling
  148.                        process's child processes terminate, and then returns a
  149.                        value of -1 with _eeee_rrrr_rrrr_nnnn_oooo set to _EEEE_CCCC_HHHH_IIII_LLLL_DDDD.
  150.  
  151.           _SSSS_AAAA______NNNN_OOOO_CCCC_LLLL_DDDD_SSSS_TTTT_OOOO_PPPP If set and _s_i_g equals _SSSS_IIII_GGGG_CCCC_HHHH_LLLL_DDDD, _s_i_g will not be sent to
  152.                        the calling process when its child processes stop or
  153.                        continue.
  154.  
  155.      _s_i_g_a_c_t_i_o_n will fail and no new signal handler will be installed if one of
  156.      the following occurs:
  157.  
  158.      [EFAULT]  Either _a_c_t or _o_a_c_t points to memory that is not a valid part of
  159.                the process address space.
  160.  
  161.      [EINVAL]  _s_i_g is not a valid signal number.
  162.  
  163.      [EINVAL]  An attempt is made to ignore or supply a handler for SSSSIIIIGGGGKKKKIIIILLLLLLLL or
  164.                SSSSIIIIGGGGSSSSTTTTOOOOPPPP.
  165.  
  166. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  167.      blockproc(2), kill(2), signal(2), sigprocmask(2), sigpending(2),
  168.      sigsuspend(2), sigwait(2), sigsetjmp(3), sigset(2), setrlimit(2),
  169.      ulimit(2), wait(2), sigsetops(3), sigvec(3B), signal(5).
  170.  
  171. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  172.      A 0 value indicates that the call succeeded.  A -1 return value indicates
  173.      an error occurred and _e_r_r_n_o is set to indicate the reason.
  174.  
  175. WWWWAAAARRRRNNNNIIIINNNNGGGGSSSS
  176.      Signals raised by any instruction in the instruction stream, including
  177.      SSSSIIIIGGGGFFFFPPPPEEEE, SSSSIIIIGGGGIIIILLLLLLLL, SSSSIIIIGGGGEEEEMMMMTTTT, SSSSIIIIGGGGBBBBUUUUSSSS, and SSSSIIIIGGGGSSSSEEEEGGGGVVVV, will cause infinite loops if
  178.      their handler returns, or the action is set to SSSSIIIIGGGG____IIIIGGGGNNNN.... This is because
  179.      the exception PC at the time of the signal points to the instruction that
  180.      raised the exception or signal, and resuming the process will re-execute
  181.      that same instruction.
  182.  
  183.      The POSIX signal routines (_s_i_g_a_c_t_i_o_n(2), _s_i_g_p_e_n_d_i_n_g(2), _s_i_g_p_r_o_c_m_a_s_k(2),
  184.      _s_i_g_s_u_s_p_e_n_d(2), _s_i_g_s_e_t_j_m_p(3)), and the 4.3BSD signal routines (_s_i_g_v_e_c(3B),
  185.      _s_i_g_n_a_l(3B), _s_i_g_b_l_o_c_k(3B), _s_i_g_p_a_u_s_e(3B), _s_i_g_s_e_t_m_a_s_k(3B)) must NEVER be
  186.      used with _s_i_g_n_a_l(2) or _s_i_g_s_e_t(2).
  187.  
  188.      In multithreaded processes, _s_i_g_a_c_t_i_o_n cannot be used to predictably
  189.      affect another thread waiting for the affected signals via _s_i_g_w_a_i_t.
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.